<template>
  <van-nav-bar title="消息记录" left-text="返回" left-arrow @click-left="goBack" />
  <div v-if="recordlist.length > 0">
    <van-cell-group>
      <van-cell
        v-for="item in recordlist"
        :key="item.id"
        center
        :title="item.content"
        :value="item.createtime"
      />
    </van-cell-group>
  </div>
  <div>
    <div class="rate-empty">暂时无消费记录</div>
  </div>
</template>
<script setup>
const { cookies } = useCookies();
const router = useRouter();
const LoginUser = reactive(cookies.get("LoginUser"));
const recordlist = ref([]);
const goBack = () => {
  router.push("/business/base/index");
};
onMounted(() => {
  getRecordData();
});
const getRecordData = async () => {
  let result = await Api.record({ busid: LoginUser.id });
  if (result.code == 1) {
    recordlist.value = result.data;
  }
};
</script>
<style>
.rate-empty {
  text-align: center;
  height: 55px;
  line-height: 50px;
  color: #666;
}
</style>
